/**
 * config
 * author by luchao
 * public config
 */

/**
 * 环境变量
 */
const env: string = 'dev';

interface Api {
    url: string,
    errormsg: string
}

/**
 * PublicConfig
 */
export class PublicConfig {
    // 注册
    private register: Api = {
        url: 'register.php',
        errormsg: ''
    }

    // 验证用户名
    private ckUserName: Api = {
        url: '/api/ckUserName.php',
        errormsg: ''
    }

    // 上传文件
    private upLoadFile: Api = {
        url: '/api/upLoadFile.php',
        errormsg: ''
    }

    // 获取区域联动
    private area: Api = {
        url: 'area.php',
        errormsg: ''
    }

    // 获取验证码
    private sendMsg: Api = {
        url: 'sendMsg.php',
        errormsg: ''
    }

    // 验证验证码
    private ckCode: Api = {
        url: 'ckCode.php',
        errormsg: ''
    }

    // 登录验证
    private login: Api = {
        url: 'login.php',
        errormsg: ''
    }

    // 获取api对象
    getApiStatus(apiName: string): Api {
        return Object.assign({}, this[apiName]);
    }
}
